* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background-color: #000;
    color: #fff;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #444;
    background-color: #111;
    font-size: 14px;
}

.main-container {
    display: flex;
    flex: 1;
    padding: 5px;
    position: relative;
    overflow: hidden;
}

.game-canvas-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    border: 1px solid #333;
    border-radius: 4px;
}

canvas {
    display: block;
    background-color: #000;
    width: 100%;
    height: 100%;
}

.control-panel {
    min-width: 280px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.digital-display {
    background-color: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 13px;
}

.label {
    color: #aaa;
}

.value {
    color: #fff;
    font-weight: bold;
}

.instrument-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.instrument {
    flex: 1;
    margin: 0 5px;
}

.instrument-title {
    font-size: 11px;
    text-align: center;
    color: #ccc;
    margin-bottom: 4px;
}

.gauge {
    height: 20px;
    background-color: #222;
    border: 1px solid #444;
    position: relative;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    background-color: #fff;
}

.gauge-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.marker {
    height: 100%;
    width: 1px;
    background-color: #444;
}

.control-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.control-btn {
    background-color: #222;
    border: 1px solid #555;
    color: #fff;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    flex: 1;
    min-width: 120px;
    transition: all 0.1s;
    border-radius: 4px;
}

.engine-btn {
    background-color: #444;
}

.engine-btn.active {
    background-color: #800;
    box-shadow: 0 0 8px #f00;
}

.status-panel {
    background-color: #111;
    border: 1px solid #333;
    padding: 10px;
    margin-top: 10px;
    font-size: 12px;
    text-align: center;
    border-radius: 4px;
}

.result-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #fff;
    padding: 20px;
    text-align: center;
    z-index: 10;
    display: none;
    width: 90%;
    max-width: 350px;
    border-radius: 6px;
}

.result-panel h2 {
    margin-bottom: 15px;
    font-size: 24px;
}

.time-panel {
    position: absolute;
    white-space: nowrap;
    left: 0;
    top: 0;
}

.result-panel p {
    margin: 8px 0;
    font-size: 14px;
}

.result-panel button {
    margin-top: 15px;
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    border-radius: 4px;
}

.compass {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.compass-inner {
    width: 100px;
    height: 100px;
    border: 1px solid #555;
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center left;
    height: 2px;
    width: 40px;
    background-color: #fff;
}

.compass-label {
    position: absolute;
    font-size: 10px;
}

.compass-n {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-s {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-w {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-e {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .control-panel {
        min-width: auto;
    }

    .game-canvas-container {
        height: 40vh;
    }

    .control-buttons {
        gap: 5px;
    }

    .control-btn {
        min-width: 100px;
        padding: 8px;
        font-size: 12px;
    }

    .compass {
        margin-top: 15px;
    }
}

.moon-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

.moon-arrow {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #fff;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

.moon-distance {
    font-size: 12px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 3px 8px;
    border-radius: 10px;
}

.target-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    font-size: 14px;
}

.target-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid #0f0;
    animation: pulse 1.5s infinite;
}

.target-distance {
    white-space: nowrap; /* 不换行 */
    position: absolute;
    top:0;
    left: 100%;
    transform: translate(-100%);
    font-size: 12px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 3px 8px;
    border-radius: 10px;
    margin-top: 5px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}